package goover.unit01;
import java.util.Scanner;
//判断月份
public class SwitchDemo01 {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        while(true){
            System.out.println("请输入月份：");
            int i = scan.nextInt();
            if(i >= 0 && i <= 12){
                switch (i){
                    case 12:
                    case 1:
                    case 2:
                        System.out.println("春天！");
                        break;
                    case 3:
                    case 4:
                    case 5:
                        System.out.println("夏天！");
                        break;
                    case 6:
                    case 7:
                    case 8:
                        System.out.println("秋天！");
                        break;
                    case 9:
                    case 10:
                    case 11:
                        System.out.println("冬天！");
                        break;
                    default:
                        break;
                }
            }else{
                System.out.println("输入的月份错误！");
            }
            if(i == 0){
                System.out.println("程序已退出！");
                break;
            }
        }

    }
}
